﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Values.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type ListViewItem}">

        <Setter Property="OverridesDefaultStyle" Value="True" />

        <Setter Property="Margin">
            <Setter.Value>
                <Thickness Top="{StaticResource View.Region.Spacing.SmallValue}" />
            </Setter.Value>
        </Setter>

        <Setter Property="Padding" Value="{StaticResource ListItem.Padding.Normal}" />

        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />

        <Setter Property="Background" Value="{StaticResource ListItem.Background.Normal}" />
        <Setter Property="BorderBrush" Value="{StaticResource ListItem.BorderBrush.Normal}" />
        <Setter Property="Foreground" Value="{StaticResource ListItem.Foreground.Normal}" />

        <Setter Property="BorderThickness" Value="{StaticResource ListItem.BorderThickness.Normal}" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListViewItem}">
                    <StackPanel>
                        <Border Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{StaticResource Control.Border.CornerRadius}"
                                Padding="{TemplateBinding Padding}">
                            <GridViewRowPresenter />
                        </Border>
                        <Rectangle Height="{StaticResource Separator.Size}"
                                   Fill="{StaticResource ListItem.LineDivider.Brush}"
                                   IsHitTestVisible="False" />
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>

            <Trigger Property="ItemsControl.AlternationIndex" Value="0">
                <Setter Property="Background" Value="{StaticResource ListItem.Background.Alternation.1}" />
            </Trigger>
            <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                <Setter Property="Background" Value="{StaticResource ListItem.Background.Alternation.2}" />
            </Trigger>

            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{StaticResource ListItem.Background.Hover}" />
                <Setter Property="BorderBrush" Value="{StaticResource ListItem.BorderBrush.Hover}" />
                <Setter Property="Foreground" Value="{StaticResource ListItem.Foreground.Hover}" />
                <!--<Setter Property="BorderThickness" Value="{StaticResource ListItem.BorderThickness.Hover}" />-->
            </Trigger>

            <Trigger Property="IsSelected" Value="true">
                <Setter Property="Background" Value="{StaticResource ListItem.Background.Selected}" />
                <Setter Property="BorderBrush" Value="{StaticResource ListItem.BorderBrush.Selected}" />
                <Setter Property="Foreground" Value="{StaticResource ListItem.Foreground.Selected}" />
                <!--<Setter Property="BorderThickness" Value="{StaticResource ListItem.BorderThickness.Selected}" />-->
            </Trigger>

        </Style.Triggers>

    </Style>

</ResourceDictionary>